package extendS;

class A{
   public int a=1;
   public static int b=2;
   public  void funA1(){
       System.out.println("父类普通成员方法");
   }

   public  static A funA2(){
       System.out.println("父类静态成员方法");
       return new A();
   }
}

class B extends A {
    //在子类中定义与父类重名成员a
   public int a=3;
   public int d=4;
    public  void funA1(){
        System.out.println("子类静态成员方法");
        super.funA1();
        funA2();
    }
   public static B funA2(){
       System.out.println("子类中的tongming方法");
       //System.out.println(a);
       //System.out.println(super.a);
       //System.out.println(b);
       //System.out.println(d);
        //funA1();
       // A.funA2();
       System.out.println("----------");
       return new B();
   }}


public class demo1 {
    public static void main(String[] args) {
        A a=new B();
       //b.test();
      a.funA2();
    }
}
